/*
 *  mih_service_management.h
 *  MIHF
 *
 *  Created by injae song on 11. 3. 4..
 *  Copyright 2011 KyungHee Univ. All rights reserved.
 *
 */

#ifndef MIH_SERVICE_MANAGEMENT_H
#define MIH_SERVICE_MANAGEMENT_H

#include "mih_message.h"
#include "mih_user.h"
#include "mihf.h"
#include "mih_event_service.h"
#include "mih_protocol.h"
#include "mih_sap.h"
#include "mih_tlv.h"
#include "mih_type.h"

typedef void (*mih_event_callback) (mih_message* , void *arg);

typedef struct _mih_events_indication_callback {
	
    
	mih_event_callback cb;
	
	void *cb_arg;
	
}mih_event_indication_callback;


typedef struct _mih_event {
	
	MIH_EVT_LIST type;
	
	void *evdata;
	
	int iscustom;
	
	mih_event_indication_callback *callback; //mih_event_indication_callback
}mih_event;

void mih_service_management_dispatch( mih_message* msg,   mih_user *from_user);

mih_message*  mih_event_subscribe_request(mih_message *msg, mih_user* user);

void mih_events_subscribe(MIH_EVT_LIST ev_type, mih_event_callback cb, void *cb_arg);
mih_message* mih_event_unsubscribe_request(mih_message *msg, mih_user* user);

void mih_send_event_subscribe_request(mih_message *msg,  mih_user *from_user);

void mih_event_subscribe_confirm(int status, mih_message *msg, void *user);

void mih_event_subscription_forward_setup(mih_message *msg, void *user);

void mih_user_notify_event(mih_message *message, void *_user);

mih_message* mih_capability_discover_request(mih_message *msg, mihf* mih, mih_user* user);

#endif